<template>
  <div class="searchresult_tablist" v-if="items.length > 0">
    <van-list
      v-model="loading"
      :finished="finished"
      :finished-text="$t('lang.已经到底了')"
      :error.sync="error"
      :error-text="this.$t('lang.请求失败，点击重新加载')"
      @load="onLoad"
      v-if="items.length > 0"
    >
      <div v-for="(item, index) in items" :key="'tablist_' + index">
        <ItemPanelHeader :item="item" :isBigHead="isBigHead">
          <!--         <div slot="itemPanelHeaderMenu">3</div>
 -->
        </ItemPanelHeader>
      </div>
    </van-list>
    <div v-else class="nodata">
      <NoContent :type="noContentType"></NoContent>
    </div>
  </div>
</template>
<script>
export default {
  name: "SearchResultTabList",
  props: {
    tab: {
      type: Object,
      default() {
        return {};
      },
    },
  },
  components: {
    ItemPanelHeader: () =>
      import(
        /* webpackChunkName: "itemImgHead" */ "../../components/common/itemPanel/itemPanelHeader.vue"
      ),
    NoContent: () =>
      import(
        /* webpackChunkName:"noContent" */ "../../components/common/noContent.vue"
      ),
  },
  data() {
    return {
      loading: false,
      finished: true,
      error: false,
      items: [],
      key: this.$route.params.key || "",
      isBigHead: true,
      noContentType: 10,
    };
  },
  created() {
    let items = {
      account: [
        {
          id: "0123456",
          userId: "0123456",
          userHead:
            "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1595233833221&di=8cf8621bb5bdae4844362dfe99c54191&imgtype=0&src=http%3A%2F%2Fb.hiphotos.baidu.com%2Fimage%2Fpic%2Fitem%2Fbd315c6034a85edf8c1758e240540923dc547553.jpg",
          nickName: "0undefined",
          position: "中国",
          isNewContent: true,
        },
      ],
      label: [
        {
          id: "0123456",
          userId: "0123456",
          userHead:
            "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1595233833221&di=8cf8621bb5bdae4844362dfe99c54191&imgtype=0&src=http%3A%2F%2Fb.hiphotos.baidu.com%2Fimage%2Fpic%2Fitem%2Fbd315c6034a85edf8c1758e240540923dc547553.jpg",
          nickName: "1undefined",
          position: "中国",
          isNewContent: true,
        },
      ],
      location: [
        {
          id: "0123456",
          userId: "0123456",
          userHead:
            "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1595233833221&di=8cf8621bb5bdae4844362dfe99c54191&imgtype=0&src=http%3A%2F%2Fb.hiphotos.baidu.com%2Fimage%2Fpic%2Fitem%2Fbd315c6034a85edf8c1758e240540923dc547553.jpg",
          nickName: "2undefined",
          position: "中国",
          isNewContent: true,
        },
      ],
    };
    this.items = items[this.$props.tab.tabKey];
  },
  methods: {
    onLoad() {},
  },
};
</script>
<style lang="less">
@base: 23.44rem;
.searchresult_tablist {
}
</style>
